package com.gao.pv;

/**
 * @Author: ShanYuqing
 * @Version: v1.0
 */
public class Productor implements Runnable {

    @Override
    public void run() {
        while (true) {
            Share.lock.lock();
            if(Share.mark){
                try {
                    Share.producer.await();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }else{
                System.out.println("生产者生产包子");
                Share.mark = true;
                Share.consumer.signal();
            }
            Share.lock.unlock();
        }
    }
}

